/**
 * 
 */
package com.hexacta.hrs.web.util;

import javax.servlet.jsp.PageContext;

import org.displaytag.decorator.DisplaytagColumnDecorator;
import org.displaytag.exception.DecoratorException;
import org.displaytag.properties.MediaTypeEnum;

/**
 * Decorator para la columna de Evaluation Generation Type
 * 
 * @author mtestasecca
 *
 */
public class EvaluationTypesDecorator implements DisplaytagColumnDecorator {
	
	private static final String GENERATED_ALL_SHORT = "A";
	private static final String GENERATED_SINGLE_SHORT = "S";

	private static final String GENERATED_ALL = "All";
	private static final String GENERATED_SINGLE = "Single";

	public Object decorate(Object arg0, PageContext arg1, MediaTypeEnum arg2)
			throws DecoratorException {
		
		if (arg0 == null) { 
			return "";
		}
		
		if (arg0.equals(GENERATED_ALL_SHORT)) {
			return GENERATED_ALL;
		} else {
			if (arg0.equals(GENERATED_SINGLE_SHORT)) {
				return GENERATED_SINGLE;
			}
		}
		return "";
	}
}